package com.example.demo2.demo00;

import com.rabbitmq.client.ConfirmListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

/**
 * @Description: 发送消息监听
 * @Author: mingtian
 * @CreateDate: 2021/1/22 17:37
 * @Version: 1.0
 */
public class RabbitConfirmListener implements ConfirmListener {

    /**
     * 打印日志
     */
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public void handleAck(long deliveryTag, boolean multiple) throws IOException {
        logger.info("handleAck 投递消息成功,deliveryTag:{}", deliveryTag);
    }

    @Override
    public void handleNack(long deliveryTag, boolean multiple) throws IOException {
        logger.info("handleNack deliveryTag:{}", deliveryTag);
    }
}